package com.cp_smss.web;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.cp_smss.model.User;

@Controller
public class FirstController {
	
	@RequestMapping(value="/hello")
	public String Hello(ModelMap modelMap){
		modelMap.put("cc", "fuck you");
		return "test";
	}
	
	@RequestMapping(value="/hello2")
	@ResponseBody
	public String HelloInAjax(ModelMap modelMap){
		modelMap.put("dd", "shit");
		return "ajaxTest";
	}
	
	@RequestMapping(value="/hello3")
	@ResponseBody
	public Object HelloInGson(ModelMap modelMap){
		User u = new User();
		u.setId(123);
		u.setName("carlos");
		return u;
	}
	
	@RequestMapping(value="/login")
	public String layout(Model model){
		return "layout";
	}
}